package com.kingsoft.miot.bridge.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 
 * @author HUJIANQING
 * 
 *         请求转发
 *
 */
@Controller
public class PreOptionController {

	@RequestMapping(value = "/", method = RequestMethod.POST)
	public void preOption(HttpServletRequest request, Model model, HttpServletResponse response) {
		try {
			Object attribute = request.getAttribute("data");
			System.out.println("数据：" + attribute);
			request.getRequestDispatcher("/test/controller").forward(request, response);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (ServletException e) {
			e.printStackTrace();
		}
		
	}
	
}
